// Learn cc.Class:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
//  - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
// Learn Attribute:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,
    
    properties: {
        canvas: cc.Node,
        lineWidth: 2,
        strokeColor: cc.color(255, 255, 255, 100),


    },
    // LIFE-CYCLE CALLBACKS:
    onLoad() {
        var self = this;
        self.ctxtemp = self.getComponent(cc.Graphics);
        self.ctxtemp.lineCap = cc.Graphics.LineCap.BUTT;
        self.ctxtemp.lineJoin = cc.Graphics.LineJoin.ROUND;
    },

    start() {

    },
    update(dt) {
        var self = this;
        self.ctxtemp.lineWidth = self.lineWidth;
        self.ctxtemp.strokeColor = self.strokeColor;

        // Starting Line
        self.ctxtemp.moveTo(0, 0);

        // var point = this.getLinePoint(time, 0, options);

        self.ctxtemp.lineTo(1000, 1000);

        // Stroke it
        self.ctxtemp.stroke();

    },
});